<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<script type="text/javascript">
  	
     $(document).ready(function () {
     var uid = $("#user\\.uid").val();
     //注意测试使用，发布后需要将uid=1注释掉
     //uid=1;
     var url = "getgoodsbyower.action?user.uid="+uid;

     $.getJSON(url, function(data) {
          console.log(data);
         $.each(data, function(i, good) {
            $("#goodsList").append(
            "<tr><td>"
            +good.category.cname
            +"</td><td>"
            +good.gname
            +"</td><td>"
            +good.gprice
            +"</td><td>"
            +good.gnumber
            +"</td><td>"
            +good.gaddress
            +"</td><td>"
            +good.gtime.toString().substring(0,10)
            +"</td><td>"
            +good.ginfo
            +"</td></tr>"
           );
        });
        });
  });
  	
  </script>
  <div class="container"> 
    <input id="user.uid" name="user.uid"  type="text" style="display:none;" value=<s:property value="#session.user.uid"/>>
    <div class="table-responsive"> 
     <table class="table table-striped table-bordered">	
        <thead>
           <tr>
             <th>类别</th>
             <th>名称</th>
             <th>价格</th>
             <th>数量</th>
             <th>地址</th>
             <th>时间</th>
             <th>商品简短说明</th>
           </tr>
         </thead>
         <tbody id="goodsList">
         
         </tbody>
         </table>
    </div>
   
   

  </div>
